home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Text / HTML / HTMLEXT / GUI / func.mfind < prev    next >
Text File  |  2000-03-14  |  5KB  |  176 lines

  1. G4C
  2. ; $VER: func.mfind Rev.018 by Juan Manuel Wehrli 1999 - 2000
  3. WINBIG -1 -1 350 130 "Durchsuchen"
  4. WinType 11010000
  5. WinBackground IMAGE BG 0
  6. Winout "NIL:"
  7.  
  8. xOnLoad
  9.     SetGad #This 100 HIDE
  10.     SetGad #This 101 HIDE
  11.     if $*was = 1
  12.         SetGad #This 2 OFF
  13.     elseif $*was != 1
  14.         SetGad #This 2 ON
  15.     endif
  16.     GuiOpen #This
  17.  
  18. xOnOpen
  19.     if $*suchstr != ""
  20.         SetVar suchstr $*suchstr
  21.         Update #This 1 $*suchstr
  22.     endif
  23.     if $*filestr != ""
  24.         SetVar filestr $*filestr
  25.         Update #This 4 $*filestr
  26.     endif
  27.     if $*art != ""
  28.         SetVar art $*art
  29.         Update #This 2 $*art
  30.     elseif $*art == ""
  31.         SetVar *art "0"
  32.         SetVar art "0"
  33.         Update #This 2 "0"
  34.     endif
  35.     if $*was != ""
  36.         SetVar was $*was
  37.         Update #This 3 $*was
  38.     elseif $*was == ""
  39.         SetVar was "0"
  40.         SetVar *was "0"
  41.         Update #This 3 "0"
  42.     endif
  43.  
  44. xOnQuit
  45.     SetVar *suchstr $suchstr
  46.     SetVar *filestr $filestr
  47.     SetVar *art $art
  48.     SetVar *was $was
  49.  
  50. ;Hintergrund Listview
  51.     XLISTVIEW 1300 1000 50 55 "" "liste" "" 0 "Multi"
  52.     GadID 100
  53.  
  54. XLISTVIEW 1300 1000 50 55 "" "liste2" "" 0 "Multi"
  55.     GadID 101
  56.  
  57. xTextIn 125 5 200 20 "Namensmuster:" filestr "#?" 255
  58.     GadID 4
  59.     GadFont "xHelvetica.font" "11" 000
  60.     SetVar *filestr $filestr
  61.  
  62. xTextIn 125 25 200 20 "Suche in Datei nach:" suchstr "" 255
  63.     GadID 1
  64.     GadFont "xHelvetica.font" "11" 000
  65.     SetVar *suchstr $suchstr
  66.  
  67. xRadio 125 60 12 12 art 5
  68.     GadFont "xHelvetica.font" "11" 000
  69.     GadID 2
  70.     RSTR "Auflisten" "0"
  71.     RSTR "Öffnen" "1"
  72.  
  73. xRadio 312 60 12 12 was 5
  74.     GadFont "xHelvetica.font" "11" 000
  75.     GadID 3
  76.     RSTR "Selektierte Dateien" "0"
  77.     RSTR "Verzeichnis sammt Unterverz." "1"
  78.     if $was = 1
  79.         SetGad #This 2 OFF
  80.     elseif $was = 0
  81.         SetGad #This 2 ON
  82.     endif
  83.     PartRedraw #This 125 60 20 50
  84.  
  85.  
  86. xButton 5 105 85 18 "_1 Starten"
  87.     GadKey "1"
  88.     GadFont "xHelvetica.font" "11" 000
  89.     GuiClose #This
  90.     Update "Infobar" 1 "Suche ... Bitte haben Sie Geduld, kann eine Weile dauern ..."
  91.     if $was = "0"
  92.         if $art = "0"
  93.             LVUSE HTMLEXT 3
  94.             LVMulti First
  95.             while $$lv.line > ""
  96.                 JoinFile $$lv.dir $$lv.rec file
  97.                 Update "Infobar" 1 "Durchsuche $file nach $suchstr ..."
  98.                 CLI 'search FROM $file SEARCH $suchstr QUIET PATTERN >t:HTMLEXT/find.list'
  99.                 CLI 'LIST LFORMAT="%L" t:HTMLEXT/find.list >env:.htmlext.tmp'
  100.                 if $.htmlext.tmp = "empty"
  101.                     CLI 'delete t:HTMLEXT/find.list'
  102.                     Update "Infobar" 1 "Durchsuche ... Nichts gefunden!"
  103.                 else
  104.                     LVUSE #This 100
  105.                     LVGO FIRST
  106.                     LVADD "$file"
  107.                     Update "Infobar" 1 "Füge Eintrag $file hinzu ..."
  108.                     LVUSE HTMLEXT 3
  109.                 endif
  110.                 LVMulti OFF
  111.                 LVMulti Show
  112.                 LVMulti First
  113.             EndWhile
  114.             LVUSE #This 100
  115.             LVSave "t:htmlext/find.list2"
  116.             GuiLoad "htmlext:gui/func.mfindlv"
  117.             Update "Infobar" 1 "Komplett!"
  118.             LVUSE func.mfindlv 1
  119.             LVChange "t:htmlext/find.list2"
  120.         elseif $art = "1"
  121.             LVUSE HTMLEXT 3
  122.             LVMulti First
  123.             while $$lv.line > ""
  124.                 JoinFile $$lv.dir $$lv.rec file
  125.                 Update "Infobar" 1 "Durchsuche $file nach $suchstr ..."
  126.                 CLI 'search FROM $file SEARCH "$suchstr" QUIET >t:HTMLEXT/find.list'
  127.                 CLI 'LIST LFORMAT="%L" t:HTMLEXT/find.list >env:.htmlext.tmp'
  128.                 if $.htmlext.tmp = "empty"
  129.                     CLI 'delete t:HTMLEXT/find.list'
  130.                     Update "Infobar" 1 "Durchsuche ... Nichts gefunden!"
  131.                 else
  132.                     Update "Infobar" 1 "Öffne $file mit Editor ..."
  133.                     CLI 'rx $*EDITOR OPENNEW "$file"'
  134.                     CLI 'rx $*EDITOR FIND "$suchstr"'
  135.                 endif
  136.                 LVMulti OFF
  137.                 LVMulti Show
  138.                 LVMulti First
  139.             EndWhile
  140.         endif
  141.     elseif $was = "1"
  142.         LVUSE HTMLEXT 3
  143.         Update "Infobar" 1 "Suche alle Dateien im Verzeichnis $$LV.DIR die dem Pattern $filestr entsprechen."
  144.         FailAt 21
  145.         CLI 'LIST $$LV.DIR PAT="$filestr" LFORMAT="%P%N" ALL >t:HTMLEXT/find.list'
  146.         LVUSE #This 100
  147.         LVChange "t:htmlext/find.list"
  148.         LVMulti ALL
  149.         LVMulti First
  150.         Update "Infobar" 1 "Durchsuche herausgefilterte Dateien ...  anz.: $$LV.TOTAL"
  151.         while $$lv.line > ""
  152.             Update "Infobar" 1 "Durchsuche Datei $$LV.REC ...  $$LV.LINE / $$LV.TOTAL"
  153.             CLI 'search FROM "$$LV.REC" SEARCH "$suchstr" QUIET PATTERN >env:.htmlext.tmp'
  154.             if $.htmlext.tmp != ""
  155.                 LVUSE #This 101
  156.                 LVADD $.htmlext.tmp
  157.                 Update "Infobar" 1 "Suchmuster gefunden ... bisher $$LV.TOTAL Einträge gefunden."
  158.                 LVUSE #This 100
  159.             endif
  160.             LVMulti OFF
  161.             LVMulti First
  162.         endwhile
  163.         LVUSE #This 101
  164.         Update "Infobar" 1 "Suche abgeschlossen ... Suchmuster $$LV.TOTAL gefunden ..."
  165.         LVSave "t:htmlext/find.list2"
  166.         GuiLoad "htmlext:gui/func.mfindlv"
  167.         CLI 'delete t:HTMLEXT/find.list'
  168.     endif
  169.     GuiQuit #This
  170.  
  171. xButton 260 105 85 18 "[_x] Abbrechen"
  172.     GadKey "x"
  173.     GadFont "xHelvetica.font" "11" 000
  174.     GuiQuit #This
  175.  
  176.